package com.kefu.robot.vo;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.IdUtil;
import com.kefu.common.context.KefuContext;
import com.kefu.common.vo.AbstractInsertVo;
import com.kefu.robot.model.RobotDocNode;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@ApiModel(description = "多轮问题节点")
public class RobotDocNodeInsertVo extends AbstractInsertVo<RobotDocNode> {
    @ApiModelProperty(value = "词条id")
    private String docId;
    @ApiModelProperty(value = "节点类型：1文字列表，2内容展示，3页面嵌入，4常见问题,5接口调用")
    private Integer nodeType;
    @ApiModelProperty(value = "常见问题")
    private String faqId;
    @ApiModelProperty(value = "节点名称")
    private String nodeName;
    @ApiModelProperty(value = "节点内容")
    private String nodeContent;
    @ApiModelProperty(value = "首节点：0否，1是")
    private Integer isFirst;

    @Override
    public RobotDocNode convert() {
        RobotDocNode info = BeanUtil.toBean(this, RobotDocNode.class);
        KefuContext context = KefuContext.getKefuContext();
		info.setNodeId(IdUtil.simpleUUID());
	    info.setCreateTime(context.getNow());
	    return info;
	}
}